#coding=utf-8
import string
a = "aAsmr3idd4bgs7Dlsf9eAF"
#a = ''.join([x for x in a if not  x.isdigit()])

l = sorted(a)
[ (a,b) for x in l if x.isupper(): a elif: x.islower() b else: pass ]
[y for y in a y_lower = y.lower() if y_lower in b: b.insert(b.keys(y.lower),y]


print "".join(b)
 